﻿@model ShoppingCartModel.RewardPointsBoxModel

@using SmartStore.Web.Models.ShoppingCart;

@{
    if (!Model.DisplayRewardPoints)
    {
        return;
    }

    var isExpanded = Model.UseRewardPoints;
}

<div class="cart-action cart-action-rewardpoints">
    <h5 class="cart-action-title@(isExpanded ? "" : " collapsed")" data-toggle="collapse" data-target="#cart-action-rewardpoints-body" aria-controls="cart-action-rewardpoints-body" aria-expanded="@isExpanded">
        @T("ShoppingCart.RewardPoints")
    </h5>

    <div class="cart-action-body collapse@(isExpanded ? " show" : "")" id="cart-action-rewardpoints-body" aria-expanded="@isExpanded">
        <div class="reward-points alert alert-info">
            <div class="form-check">
				@Html.CheckBoxFor(model => model.UseRewardPoints, new { @class = "form-check-input" })
                <label class="form-check-label" for="@Html.IdFor(model => model.UseRewardPoints)"> 
                    @Html.Raw(string.Format(T("Checkout.UseRewardPoints").Text, "<strong>" + Model.RewardPointsBalance + "</strong>", "<strong>" + Model.RewardPointsAmount + "</strong>"))
                </label>
            </div>
        </div>

        <div class="form-group">
            <button type="submit" name="applyrewardpoints" value="applyrewardpoints" class="btn btn-primary">
                <i class="fa fa-check"></i>
                <span>@T("ShoppingCart.RewardPoints.Button")</span>
            </button>
        </div>
    </div>
</div>